Drag and Drop from Listview to Treeview

Hi All,

I'm trying to implement drag and drop between from a listview to a treeview.

In my listview definition, I have a callback function. In my treeview definition, I have the same callback function as below.
void mylistcallback(DropEvent de)
{
bool b = de.sourceIsListView
bool b1 = de.targetIsTreeView

print "list : " b "\n"
print "tree : " b1 ""

// index in the listview
print de.sourceIndex "\n"
}

ctlTreeViewLRU = treeView(dbReqBox, mylistcallback, 0, 300, 15)
...
ctlListViewLRUItem = listView(dbReqBox, mylistcallback, listViewOptionSortText, 700, 15, dummy)
I can get the index of the element I want to drag (into the list view). But I can't get the indew in the treeview where I want to drop the element coming from my listview

How can I know where I want to insert my element in the treeview ?

Thanks and regards

David
SystemAdmin - Thu Mar 21 11:01:07 EDT 2013

Re: Drag and Drop from Listview to Treeview
SystemAdmin - Thu Mar 21 11:32:50 EDT 2013

I answer my own topic !!

I tried the property 'targetPath' on the dropEvent and it works. I can get the path in the target treeview although the DXL reference manual stipulate the following :

'targetPath: The path of the target item of a drag operation; this is only valid if targetIsListView is true, otherwise, it is null'

but in my case, targetIsListView is false since my target is a treeview !!!!

The documentation doesn't seems to be up to date !!!

Re: Drag and Drop from Listview to Treeview
SystemAdmin - Thu Mar 21 12:29:42 EDT 2013

SystemAdmin - Thu Mar 21 11:32:50 EDT 2013
I answer my own topic !!

I tried the property 'targetPath' on the dropEvent and it works. I can get the path in the target treeview although the DXL reference manual stipulate the following :

'targetPath: The path of the target item of a drag operation; this is only valid if targetIsListView is true, otherwise, it is null'

but in my case, targetIsListView is false since my target is a treeview !!!!

The documentation doesn't seems to be up to date !!!

The documentation doesn't seems to be up to date !!!

Welcome to DOORS DXL development :-)

 

 

 

  • Pekka Mäkinen - http://www.softqa.eu/

 

 

Re: Drag and Drop from Listview to Treeview
DesHao - Fri May 17 10:53:08 EDT 2013

Hi,

If I understood it right, you want to drag an item from the list view and drop it into dbe like a mini explorer?

so you can replace the "block" function with the "show" function. after that both list view and tree view will be "true" and you can proceed.

regards

Hao